// CurvingNozzle.cpp: implementation of the CurvingNozzle class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "CurvingNozzle.h"
#include "CurvingNozzleGeometry.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

UE_IMPLEMENT_DYNAMIC(CurvingNozzle,Nozzle)

CurvingNozzle::CurvingNozzle()
{
	this->SetDiameter(40.0);
	/*m_FixPos.set(500,0,0);
	m_PrimaryDir.set(-1,0,0);
	m_SecondaryDir.set(-1,-1,0);
	
	m_dPrimaryLength =500;	
	m_dSecondaryLength = 500;

	m_dCurvousRadius = 200 ;*/
}

CurvingNozzle::~CurvingNozzle()
{

}

void CurvingNozzle::TransformBy(const AcGeMatrix3d &mtForm)
{
	m_PrimaryDir= mtForm*m_PrimaryDir ;
	m_SecondaryDir = mtForm*m_SecondaryDir;
	Nozzle::TransformBy(mtForm);
}

PersistentObject* CurvingNozzle::Clone()
{
	int length = sizeof(CurvingNozzle);
	char* pclone = new char[length];
	CurvingNozzle* pNew = NULL;

	memcpy(pclone, this, length);
	pNew = (CurvingNozzle*)pclone;

	CurvingNozzleGeometry* pSNG = ((CurvingNozzleGeometry*)(pNew->m_pCurGeo));

	pNew->m_pCurGeo = pSNG->Clone();
	((CurvingNozzleGeometry*)pNew->m_pCurGeo)->SetpElement(this);
	return pNew;
}
